package sg.edu.nus.dashboard.service.dbconn;

import java.sql.Connection;
import java.sql.DriverManager;

public class ConnectionService {

	public Connection getConnection() {

		try {

			Class.forName("oracle.jdbc.OracleDriver");
			Connection con = DriverManager.getConnection(DBConstants.URL,
					DBConstants.USERNAME, DBConstants.PASSWORD);
			return con;

		} catch (Exception e) {
			e.printStackTrace();
			return null;
		}
	}

	public String getConnectionInfo() {
		return ">> " + DBConstants.USERNAME + " @ " + DBConstants.IP + " : "
				+ DBConstants.PORT + " : " + DBConstants.INSTANCE;
	}

	public static void main(String[] args) {
	}
}
